-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add support for 'json_name' annotation #408
Conversation
@ajaykarthikr thanks, looks great! One small question about the |
@stephenh I don't think there's a way to know if the user had actually set the
So, I just removed the Anyway, if you read the language guide for proto3, If there's an usecase, we can probably give an option to the user to dynamically change casing to |
@ajaykarthikr ah, gotcha, I didn't realize that Okay, yeah, I think this PR makes sense / is great. It is technically a breaking change for users that were using If users report breaking changes and want to keep the old behavior, I think maybe turning Going to hit merge; thanks! |
# [1.90.0](v1.89.0...v1.90.0) (2021-11-24) ### Features * Add support for 'json_name' annotation ([#408](#408)) ([b519717](b519717))
🎉 This PR is included in version 1.90.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Inspired by #210, this PR adds support for
json_name
as per @stephenh's feedback on that PR.I made changes to
generateFromJson
andgenerateToJson
functions and created a new functiondetermineFieldJsonName
for json field names. If thejson_name
is not present in the proto file it uses the name attribute for json field names.There's also a simple unit test for testing this feature.